-
Notifications
You must be signed in to change notification settings - Fork 0
[CORRUPTED] Synthetic Benchmark PR #138126 - Fix stats performance #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_138126_20251204_6245
Are you sure you want to change the base?
[CORRUPTED] Synthetic Benchmark PR #138126 - Fix stats performance #30
Conversation
… is very large (elastic#130857)" (elastic#137973) (elastic#137984) This reverts commit 391de08.
… to avoid the N^2 performance in TransportIndicesStatsAction if the user did not ask for query cache stats (although it is still there if the user asks for query cache stats). It also avoid O(N) performance in TransportClusterStatsAction if the user did not ask for query cache stats
…performance when a user asks for query cache stats
Co-authored-by: Copilot <[email protected]>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
User description
Benchmark PR elastic#138126
Type: Corrupted (contains bugs)
Original PR Title: Fix stats performance
Original PR Description: This fixes the N^2 performance problem described in elastic#97222. In addition to restoring the previous partial fix (elastic#130857), it does the following:
Closes elastic#97222
Original PR URL: elastic#138126
PR Type
Bug fix, Enhancement
Description
Fixes N^2 performance problem in stats APIs by using Supplier pattern for query cache stats computation
Introduces CacheTotals record and refactors shared RAM calculation to avoid redundant iterations
Implements NodeContext in TransportBroadcastByNodeAction to share cache state across shard operations
Updates CommonStats.getShardLevelStats to accept precomputed shared RAM supplier parameter
Refactors IndicesQueryCache with new static methods for computing cache totals and shared RAM per shard
Diagram Walkthrough
File Walkthrough
5 files
Refactor cache stats computation with new static methodsAdd precomputed shared RAM supplier parameter to getShardLevelStatsImplement NodeContext for sharing cache state across shardsUse CachedSupplier to defer query cache computationPrecompute shared RAM map before iterating shards5 files
Update tests to pass precomputed shared RAM supplierUpdate test to pass shared RAM supplier parameterUpdate test to pass shared RAM supplier parameterUpdate test to pass shared RAM supplier parameterUpdate mocks to handle new precomputed shared RAM parameter1 files
Add changelog entry for stats performance fix